﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace FAP_GUI.UC
{
    public partial class ucListTask : UserControl
    {
        public ucListTask()
        {
            InitializeComponent();
        }

        List<FAP.Cores.Task.FapTask> thread = new List<FAP.Cores.Task.FapTask>();
        private void LoadLV()
        {
            ListViewItem lvitem;
            //List<FAP.Cores.Threading.FapTask> thread = new List<Cores.Threading.FapTask>();
            for (int i = 0; i < thread.Count; i++)
            {
                lvitem = new ListViewItem();
                lvitem.SubItems.Add((i + 1).ToString());
                lvitem.SubItems.Add("");
                lvitem.SubItems.Add(thread[i].TaskIndex.ToString());
                lvitem.SubItems.Add(thread[i].TaskName);
                lvitem.SubItems.Add("");
                lvitem.SubItems.Add(thread[i].Status.ToString());

                lvListTask.Items.Add(lvitem);
            }
        }

        private void ucListTask_Load(object sender, EventArgs e)
        {
            ListViewItem lvitem;

            for (int i = 1; i < 7; i++)
            {
                lvitem = new ListViewItem();
                lvitem.SubItems.Add((i + 1).ToString());
                lvitem.SubItems.Add("Gia Lap " + i);
                lvitem.SubItems.Add("Gia Lap " + i);
                lvitem.SubItems.Add("Gia Lap " + i);
                lvitem.SubItems.Add("Gia Lap " + i);
                lvitem.SubItems.Add("Gia Lap " + i);

                lvListTask.Items.Add(lvitem);
            }
            LoadLV();
        }
    }
}
